UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1NrP+/JMmMENv3zupQsXI+Qpo53R9XyvsdDv18Qa1/U=' 
WHERE 
  key_id = '2804fa2c66eff9558ce2dc26a49d65fdeec80221611d7ccebcf1dbdfe3841383' 
  AND (
    token = '1NrP+/JMmMENv3zupQsXI+Qpo53R9XyvsdDv18Qa1/U=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035