UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'LzFRwUmS2Cf0KCfI2ujYABRL3p2vnlb5yIr6cd7CbdM=' 
WHERE 
  key_id = 'c0953b28176b1ec94cd851e60cf61ad702fed77d046a5abe1ad9140828fdb6b7' 
  AND (
    token = 'LzFRwUmS2Cf0KCfI2ujYABRL3p2vnlb5yIr6cd7CbdM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00069