UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'aVPZAegHILA+kBskRA9hLmuo5pyhS77ZaGDcVXHcc48='
WHERE
key_id = 'c4b27cf7973117ff5b7b6652f6e8f047f832acb7d267b59272fe3eeb5bba53ea'
AND (
token = 'aVPZAegHILA+kBskRA9hLmuo5pyhS77ZaGDcVXHcc48='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)