UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'G3p5hgd/gH+wx8VSna1u/XtegLXvFYYPgOl5aNHvUwU=' 
WHERE 
  key_id = '0a6aa7b65c99df775c714f7888d4c339be559ebb8c9184af0e3fbd11d4124613' 
  AND (
    token = 'G3p5hgd/gH+wx8VSna1u/XtegLXvFYYPgOl5aNHvUwU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034