UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'i5mP+uniNWGl5vY0UritSf2fUoNoDWpvXa5skLMxdbU=' 
WHERE 
  key_id = '428344a38a1518bcd86019a990fb20dbdae0336a39e6700a87869040d0637c9f' 
  AND (
    token = 'i5mP+uniNWGl5vY0UritSf2fUoNoDWpvXa5skLMxdbU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033