UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xnK/LyCSSCsMunaiHdTGT9o4HgUmWiFrUbsEEbl5G4o='
WHERE
key_id = '6ad169371df8f0dc6b56448f3a37f12f3e38d4135eda99a717ed0418eb013950'
AND (
token = 'xnK/LyCSSCsMunaiHdTGT9o4HgUmWiFrUbsEEbl5G4o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)