UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'gSsptNu/xfq959gGMV1OmMGDfBnW/4AFdbbtcB8FjfI=' 
WHERE 
  key_id = 'dd72b4e6ff044c6ac4c32c5dfdc7cec5912e0a3bf67908d1992dfa2395bf08e1' 
  AND (
    token = 'gSsptNu/xfq959gGMV1OmMGDfBnW/4AFdbbtcB8FjfI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017