UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hZYOBdhRLbQkgc50DbiI7FNAZh/NJ2rKiMwpA04kQv8='
WHERE
key_id = 'f60bf2cc9da3c2cccab36f7bd7bf8aec3243e9a35c669e99988d1e9c908e1c5c'
AND (
token = 'hZYOBdhRLbQkgc50DbiI7FNAZh/NJ2rKiMwpA04kQv8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)