UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '15IwySEJwJWKN3lzTGf3C+VWQJ9KHCUuDy/hiKXwJ6I=' 
WHERE 
  key_id = 'bfacc4a08aed9a1eac4b580ad847dc073c2659dedb9d783362279bfe24bb7302' 
  AND (
    token = '15IwySEJwJWKN3lzTGf3C+VWQJ9KHCUuDy/hiKXwJ6I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026