UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+S+VPe8APh4vDVIxQEeXmi3LGQpOsaeFElwQhhVurOY='
WHERE
key_id = 'b72e944b0bfc8f9ec3a9c5e662f02d980e9b952f49960c6d404a9fc831e50df4'
AND (
token = '+S+VPe8APh4vDVIxQEeXmi3LGQpOsaeFElwQhhVurOY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)