UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'iVO/htbEHIxkE0HAjrv+ruGDkoqhF1vOFy4wdMKSUJw=' 
WHERE 
  key_id = '6a0fac2c10270aaa30600e62b72e6b1a34249dceb8a838b5bb55b9293644596e' 
  AND (
    token = 'iVO/htbEHIxkE0HAjrv+ruGDkoqhF1vOFy4wdMKSUJw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035