UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'FnFL9f979pCRxcNBAJyJrJ4mfLX5vF8ujoauOB8ri2E='
WHERE
key_id = 'afaadc49a2bce7695c5d82e9fa43fc42b650453fa63707c5bdc1a578ca0bbf9d'
AND (
token = 'FnFL9f979pCRxcNBAJyJrJ4mfLX5vF8ujoauOB8ri2E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)