UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '97XYfLYc3LLzXpBzbOgZyfcHT2oN4V2Gu5RqwpNK4Nw='
WHERE
key_id = 'e8cd5426fd56b8f4f0f8de335fa78785534d5197ef1a1b4d4d51e0d64619051c'
AND (
token = '97XYfLYc3LLzXpBzbOgZyfcHT2oN4V2Gu5RqwpNK4Nw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)