UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '++z4GttTeX3h42JDOuqeIXME9vGTixSnmTZkl5WYq9Y='
WHERE
key_id = '17449361cc901604d0f2e14202f0fca3b45e1508acd969a014953a95eb99b8b8'
AND (
token = '++z4GttTeX3h42JDOuqeIXME9vGTixSnmTZkl5WYq9Y='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)