UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'nb1Ze4d9e01hUxm/sC1jLM9mw/tPumeDIslm6hsnLPg='
WHERE
key_id = '7a19bad739b1b621ca1bf77f6d1ccc592939bfbd122804d3c2e972ce5dce1c13'
AND (
token = 'nb1Ze4d9e01hUxm/sC1jLM9mw/tPumeDIslm6hsnLPg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)