UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'czSr0gY5IhjqJvKPT9ZbxVQ1mddYt++rDgWSCqm3VW8=' 
WHERE 
  key_id = '259922b4f06df91a90a0a9db331fff274fe932b25c462b6cd35d001bb7d92c03' 
  AND (
    token = 'czSr0gY5IhjqJvKPT9ZbxVQ1mddYt++rDgWSCqm3VW8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00053