UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'lFZoDit2PZntt29jGnkhmGRbTrX5zXIWeWn/3xIHhAU=' 
WHERE 
  key_id = 'fa1f13efc27d3dce8b35315bacb7ae38ce78cd1e4acf6ff3bbe7427e59f745b1' 
  AND (
    token = 'lFZoDit2PZntt29jGnkhmGRbTrX5zXIWeWn/3xIHhAU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029