UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Yu81Pwsr6P/W17o27Tt/POXpoXBaeVrW1K7Atmzlr6Q='
WHERE
key_id = '6f1bdb754c31ba6e952bc7d5497a207fac476a2a8faf447a9978ceec3360fa0d'
AND (
token = 'Yu81Pwsr6P/W17o27Tt/POXpoXBaeVrW1K7Atmzlr6Q='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)