UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'LHd0ssWIjEnl32CvMw89Crverk6olxJQJH+CLnwN5NA=' 
WHERE 
  key_id = 'f2e47f3bb8481df23d2f17d51b799ee220af60e81652c285e917eb79156a8c35' 
  AND (
    token = 'LHd0ssWIjEnl32CvMw89Crverk6olxJQJH+CLnwN5NA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027