UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'W16N/JLqUCKHjVfT2b79pgAV1XfofNtSMxrujk8BEoY='
WHERE
key_id = '9753c72b3367ec19e9b1592d5cd733d29fdeb740c80f442734fa7e5e89441fb4'
AND (
token = 'W16N/JLqUCKHjVfT2b79pgAV1XfofNtSMxrujk8BEoY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)