UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'mcAI2p0ZVFbdFTaJlpLyR22CdbebNl8pGvCT9V8hWlY=' 
WHERE 
  key_id = '35720532a3cb7c3d8b88a5f15f43d42e8627b1a48a90fb5e5a596aac2d82ecaf' 
  AND (
    token = 'mcAI2p0ZVFbdFTaJlpLyR22CdbebNl8pGvCT9V8hWlY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024