UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WElZhyuMpk1hJW2XIjpXHY8/tvHFMQS5YjqyoxgqrSw='
WHERE
key_id = 'c59ab893052a500dc3175c09de727c383ccb6477ddf501d4f5ff7f4ba8ddd73f'
AND (
token = 'WElZhyuMpk1hJW2XIjpXHY8/tvHFMQS5YjqyoxgqrSw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)