UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'r//Bkdv5CXQE2utTC+mB/tcXKuaFetyqWviqisVfi5c=' 
WHERE 
  key_id = 'd58da6962f92f9f36c9d07f045eaf59b1b0c5df23329eaa402b723d3aec130b3' 
  AND (
    token = 'r//Bkdv5CXQE2utTC+mB/tcXKuaFetyqWviqisVfi5c=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025