UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'z9VM2GCIANTdK9WxHFOB8vOXmjwVaMVO/aoFhmrlkjw='
WHERE
key_id = 'fc21e25bcc529cd92b6c9fb08948ffdd463e9d0362934aa38847df71163bab60'
AND (
token = 'z9VM2GCIANTdK9WxHFOB8vOXmjwVaMVO/aoFhmrlkjw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)