UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'n4WcWUKWZUSx/+km5500yG/xka3F+LnQq8dFTWH/DWM='
WHERE
key_id = 'c262cf1ab7ed1bdb45c7605adf088d3358f7ca96a7793aabeb5804532b89fdec'
AND (
token = 'n4WcWUKWZUSx/+km5500yG/xka3F+LnQq8dFTWH/DWM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)