UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Z7voAX89JUiwu6IlwvIuKqCgjnCNJQwH9NtdwsBeif0='
WHERE
key_id = '01ff8870bab2b805dedb7eeac07f43aa0ad2acd5e18e2d6ef01be7f2f3bbc760'
AND (
token = 'Z7voAX89JUiwu6IlwvIuKqCgjnCNJQwH9NtdwsBeif0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)