UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'cVnfpu6iqxI6YNmaYwZMFE9pbTnZsOAE8vlu1biJe/s=' 
WHERE 
  key_id = '6ba058b43bfd29ed516492bd0e16558350091d51408fa2e094623933dd561d7a' 
  AND (
    token = 'cVnfpu6iqxI6YNmaYwZMFE9pbTnZsOAE8vlu1biJe/s=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00053