UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mQQZ1JGXjizQGPX7VCMRCVZOVIwFQrGOh4P4E+CA1Zg='
WHERE
key_id = '604b85ddcf18a5a8e6cf014f7ea5c25b5d522b6e8887bd671710e4e53b8ce801'
AND (
token = 'mQQZ1JGXjizQGPX7VCMRCVZOVIwFQrGOh4P4E+CA1Zg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)