UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0kIHJIWU0Z3ozs0GbVj5JyUUx+EKh38qT9N+XJqCgsQ='
WHERE
key_id = 'fdd0ea5b18ec8f3c33462e0801f38c5d31d4df9b588ace33419683c4d45e458f'
AND (
token = '0kIHJIWU0Z3ozs0GbVj5JyUUx+EKh38qT9N+XJqCgsQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)