UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Il7QZMBp8RQNIfKQB4Tjas2NfH0kttJoaXTVFD0MKWk='
WHERE
key_id = '3e6d4a862dfe124d2444b43631541f96c5962c4ec30f450f051a0fc5d06b0ce1'
AND (
token = 'Il7QZMBp8RQNIfKQB4Tjas2NfH0kttJoaXTVFD0MKWk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)