UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ArQKd0pm1ZzNEojzxi8cAd4fK1GpY4imEf7rhYbCjmw='
WHERE
key_id = '222a5c78bba132aba17e8b9effcd5fe5387da8383677b5f289827d7b9650f4c8'
AND (
token = 'ArQKd0pm1ZzNEojzxi8cAd4fK1GpY4imEf7rhYbCjmw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)