UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'QJrp/UTPKZ3xlKijKcMTuwBwgmIq6uE1TqlRapbG6GU='
WHERE
key_id = '0fef44d91e626ea87b4ce637c753c0a1c60f7e5783ff1ae901f3cc9372453af1'
AND (
token = 'QJrp/UTPKZ3xlKijKcMTuwBwgmIq6uE1TqlRapbG6GU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)