UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'tXdrNJH2o2o5CD9MISVYcWqhprnQDkE6v6j6ia5p8yI=' 
WHERE 
  key_id = 'a730658eb79d16d171ea0906ce69d7944e6cc425567089de42e5c314f71098fd' 
  AND (
    token = 'tXdrNJH2o2o5CD9MISVYcWqhprnQDkE6v6j6ia5p8yI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037