UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'T9P3CgI6mx3fZ9vcpiHMaicZQgNkBZXOMXJTLpJ+BIE='
WHERE
key_id = '63320f9f5872a8a2ae7d0011810f11ebcad2c25de9f2f4af84d16abe8909d5a2'
AND (
token = 'T9P3CgI6mx3fZ9vcpiHMaicZQgNkBZXOMXJTLpJ+BIE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)