UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '00GFLvAHZ79RHGR3BCW9TD5+sraYLjJXReSAs0+claM=' 
WHERE 
  key_id = '56e52bf4c2d5966544170dbb8ee5f460ee88d739052e4f5307960b81dfd069ce' 
  AND (
    token = '00GFLvAHZ79RHGR3BCW9TD5+sraYLjJXReSAs0+claM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00012