UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'GgcOwhfKX0e0tCjonEMS1vBEQHUpoLvcGr+6H4TCA4s='
WHERE
key_id = '35dc1e49c537b02356e266afbc38c9eb6e104e952fed479d0406ef78a6ac0ab1'
AND (
token = 'GgcOwhfKX0e0tCjonEMS1vBEQHUpoLvcGr+6H4TCA4s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)