UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ZbSQYo/lwnr/aJTU3/tOHhJQEQD50YEcncxpcKbKeKY='
WHERE
key_id = 'e04b528f4218705c1259c9b3119562d94983195390bf0909be585bcd2e376e51'
AND (
token = 'ZbSQYo/lwnr/aJTU3/tOHhJQEQD50YEcncxpcKbKeKY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)