UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'KbJAVVCLL6+vakj8RNRbx1pvblzEg6vBMiHtSYVQf6Y='
WHERE
key_id = '2aff48657ad4fbf3ea2d19a971863ea80e9b5c403a816817b4543ac85572af97'
AND (
token = 'KbJAVVCLL6+vakj8RNRbx1pvblzEg6vBMiHtSYVQf6Y='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)