UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '88G5nMubIyV+TU+TDowOG/pLfHASblopihVxicrjY8w='
WHERE
key_id = '7c9c1008e40dd434b5bdd8b9241ff61d9a6321c1a41473159078576177776980'
AND (
token = '88G5nMubIyV+TU+TDowOG/pLfHASblopihVxicrjY8w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)