UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'f6DKoPxEpF38HnW5bhLdLq/YzwMQ7bTj1D65ys4a4Wo=' 
WHERE 
  key_id = 'c92f8334dca0ab4e6b51a9e698f3efc9f248d685d9a58aaa58571cd5e5433f49' 
  AND (
    token = 'f6DKoPxEpF38HnW5bhLdLq/YzwMQ7bTj1D65ys4a4Wo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035