UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9DsRgLFLhTR/aN7MnX+SCqcLQrbBP+bXpEv27rkz/3Y='
WHERE
key_id = 'b223d3b76d8606d8b7fa03b96e06a154a90d3778515385fda7b74f6ad6179a1a'
AND (
token = '9DsRgLFLhTR/aN7MnX+SCqcLQrbBP+bXpEv27rkz/3Y='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)