UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ISIIZuP9MmHcaz8QbVoiyY0IWgj45JdQ1+HUA29XVJI=' 
WHERE 
  key_id = '724fb03404f68087d266ce4d626c4c1cdb9b2d1aa00561f1c72125535a97cd1f' 
  AND (
    token = 'ISIIZuP9MmHcaz8QbVoiyY0IWgj45JdQ1+HUA29XVJI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00049