UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'b7AvLTnaWunenZ8Bk796aEXM0Ocp5VSba5jyNg0xqmw='
WHERE
key_id = '5c69d850d550c01d6391502b61403aa8922b0162089fff8e254a71ac0491b90a'
AND (
token = 'b7AvLTnaWunenZ8Bk796aEXM0Ocp5VSba5jyNg0xqmw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)