UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+rRk1F9+GzvpRE7h9Agrr/18bKkQQ6qTmJ2bjVTO3Bo=' 
WHERE 
  key_id = 'a2aec4d7aa7d50f98041f912ea4ab06577fe1555e83c997a9ac9178095e64acd' 
  AND (
    token = '+rRk1F9+GzvpRE7h9Agrr/18bKkQQ6qTmJ2bjVTO3Bo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028