UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1oCZvtkFzV0lJFsoWZDlG4EuH1FiUWqUdbQawxNDHzw=' 
WHERE 
  key_id = '1f2f7786e4b7871487207d9095a2bdd3cd8756426bd3971b0553398d57ea99e5' 
  AND (
    token = '1oCZvtkFzV0lJFsoWZDlG4EuH1FiUWqUdbQawxNDHzw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00046